home *** CD-ROM | disk | FTP | other *** search
- comment /
- pwd.asm--get the present working directory--returns directory path from
- root without the leading backslash
- syntax:
- memvar=spac(64)
- load pwd
- call pwd with memvar
- ******** WARNING **********
- Russell Freeland (Synergy Corp.) 305-792-1866
- History: 1st beta 5-8-1986
- revised to fix var length 6-22-1986
- /
- CODESEG SEGMENT BYTE PUBLIC 'CODE'
- assume cs:codeseg,ds:codeseg,es:codeseg
-
- GETDIR PROC FAR
-
- START:
- mov si,bx ;move the offset of our memvar into si
- mov ah,47h ;to set up DOS function call "getdir"
- mov dl,0 ;this is for the default drive
- int 21h ;call DOS
- push es ;save es
- push ds ;need es to point to ds
- pop es
- cld ;clear the direction flag
- mov di,bx ;and load di with offset of memvar
- mov al,0 ;load al with character to find (nul)
- mov cx,64d ;scan up to 64 chars
- repe scasb ;scan it
- mov byte ptr [di],' ' ;put in a space instead of nul
- pop es ;put it back
- ret
- GETDIR ENDP
- CODESEG ENDS
- END START
-